package com.xuecheng.content.service;

import com.xuecheng.commons.model.dto.BindTeachplanMediaDto;
import com.xuecheng.commons.model.dto.TeachplanDto;
import com.xuecheng.commons.model.vo.ResponseResult;
import com.xuecheng.commons.model.vo.TeachplanVo;
import com.xuecheng.content.domain.Teachplan;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xuecheng.web.exceptions.BusinessException;

import java.util.concurrent.ExecutionException;

/**
 * <p>
 * 课程计划 服务类
 * </p>
 *
 * @author 七安
 * @since 2022-09-17
 */
public interface TeachplanService extends IService<Teachplan> {

    /**
     * 根据课程id查询课程计划。（包括1，2，3级结构）
     * @param courseId 课程id
     * @return 查到的结果
     */
    TeachplanVo findTeachplanByCourseId(Long courseId);

    /**
     * 保存或更新课程计划
     * @param teachplanDto 要存的内容
     *
     */
    void saveOrUpdatePlan(TeachplanDto teachplanDto) throws BusinessException;

    /**
     * 根据id删除章节
     *
     * @param id 要删除的id
     */
    void deletePlanById(Long id) throws BusinessException;

    /**
     * 课程绑定媒资
     *
     * @param bindTeachplanMediaDto 接收
     * @return 结果
     */
    ResponseResult mediaBindingTeachplan(BindTeachplanMediaDto bindTeachplanMediaDto) throws BusinessException;

    /**
     * 删除媒资绑定
     * @param teachPlanMediaId 媒资id
     * @param courseBaseId 课程id
     * @return 结果
     */
    ResponseResult deleteMediaBinding(Long teachPlanMediaId, Long courseBaseId) throws BusinessException;
}
